#include <iostream>
using namespace std;

void swap(int& a,int& b); //声明函数

int main() {
    int a = 100;
    int b = 200;
    cout << "交换前，a的值：" << a << endl;
    cout << "交换前，b的值：" << b << endl;

    swap(a,b);
    cout << "交换后，a的值：" << a << endl;
    cout << "交换后，b的值：" << b << endl;

    return 0;
}

void swap(int& a,int& b){
    int temp;
    temp = a;
    a = b;
    b = temp;
    return;
}